<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/userCenter.css"/>
		<link rel="shortcut icon" href="{{__PUBLIC__}}/Home/images/favicon.ico">
		<title>我的华为账号</title>
		<script type="text/javascript" src="{{__PUBLIC__}}/Home/js/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="{{__PUBLIC__}}/Home/js/area.js"></script>
		<link rel="stylesheet" href="{{__PUBLIC__}}/Home/bootstrap-3.3.5-dist/css/bootstrap.min.css">
		<script src="{{__PUBLIC__}}/Home/bootstrap-3.3.5-dist/js/jq11.min.js"></script>
		<script src="{{__PUBLIC__}}/Home/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
		<script type="text/javascript">
			$(function(){
				//初始化方法
				area.init('a');
				//修改的时候默认被选中效果
				area.selected('','');
					//修改城市
				$('#edit').click(function(){
					$(this).parents('.old').find('#show').css({display:'none'});
					$(this).parents('.old').find('.new').css({display:'block'});
				})
				$('#changePwd').click(function(){
					var oldPwd = $('#oldPwd').val();
					var password = $('#password').val();
					var confirmPwd = $('#confirmPwd').val();
					$.ajax({
						//传送地址
						url:"{{U('User/changePwd')}}",
						//传送方式
						type:"post",
						//传送数据
						data:{oldPwd:oldPwd,password:password,confirmPwd:confirmPwd},
						//数据类型
						dataType:"json",
						//成功
						success:function(data){
							alert(data);
							location.reload();
						}
					})
				})
			})
		</script>
		<style>
			#show{
				display: inline-block;
				width: 120px;
				float: left;
			}
			#edit{
				float: right;
			}
		</style>
	</head>
	<body>
		<div class="header_out">
			 <div class="header">
			 	 <div class="logo">
			 	 	我的华为帐号
			 	 </div>
			 	 <div class="right">
			 	 	<span>{{$data['neckname']}}</span>&nbsp;|&nbsp;
			 	 	<a href="{{U('Login/out')}}">退出</a>
			 	 </div>
			 </div>
		</div>
		<!--主体部分-->
		<div class="main">
			<dl>
				<form action="{{U('User/edit')}}" method="post">
			  	 <!--头像-->
			  	<dd class='up'>
			  		<img src="{{__PUBLIC__}}/Home/images/headPic.jpg.png" alt="" width=160 height=160/>
			  		<div class="div_up"><a href="">上传头像</a></div>
			  	</dd>
			  	<!--右侧信息-->
			  	<dd class='right'>
			  		<table>
			  			<tr>
			  				<td  class='td_left'>华为帐号：</td>
			  				<td class='td_right'><input type="text" name="username" value="{{$data['username']}}" class="form-control"><!-- <span class='ok_check'>已验证</span> --></td>
			  			</tr>
			  			<tr>
			  				<td class='td_left'>昵称</td>
			  				<td  class='td_right'><input type="text" name="neckname" class="form-control" placeholder="Text input" value="{{$data['neckname']}}"></td>
			  			</tr>
			  			<tr>
			  				<td class='td_left'>安全邮箱：</td>
			  				<td class='bangding'><input type="text" class="form-control" name="email" placeholder="Text input" value="{{$data['email']}}"></td>
			  			</tr>
			  			<tr>
			  				<td class='td_left'>密码：</td>
			  				<td class='change_pwd'>
			  				<button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">更改</button>
								<!-- 模态框 -->
							<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
							  <div class="modal-dialog" role="document">
							    <div class="modal-content">
							      <div class="modal-header">
							        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
							        <h4 class="modal-title" id="exampleModalLabel">修改密码</h4>
							      </div>
							      <div class="modal-body">
							          <div class="form-group">
							            <label for="recipient-name" class="control-label">旧密码:</label>
							            <input type="password" class="form-control" id="oldPwd" name="oldPwd" value="">
							          </div>
							          <div class="form-group">
							            <label for="recipient-name"  class="control-label">新密码:</label>
							            <input type="password" class="form-control" name="password" id="password" value="">
							          </div>
							          <div class="form-group">
							            <label for="recipient-name" class="control-label">确认密码:</label>
							            <input type="password" class="form-control"  name="confirmPwd"  id="confirmPwd">
							          </div>
							      </div>
							      <div class="modal-footer">
							        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
							        <button type="button" class="btn btn-primary" id="changePwd">确认提交</button>
							      </div>
							    </div>
							  </div>
							</div>
								<!-- 模态框 -->
			  				</td>
			  			</tr>
			  			<tr>
			  				<td class='td_left' class='sex'>性别：</td>
			  				<td class='sex'><input type="radio" name="sex" {{if value="$data['sex'] eq '保密'"}} checked="checked"{{endif}} value="保密" />&nbsp;保密&nbsp;&nbsp;<input type="radio" name="sex" {{if value="$data['sex'] eq '男'"}} checked="checked"{{endif}} value="男"  />&nbsp;男&nbsp;&nbsp;<input type="radio" name="sex" {{if value="$data['sex'] eq '女'"}} checked="checked"{{endif}} value="女"  />女</td>
			  			</tr>
			  			<tr>
			  				<td class='td_left'>生日：</td>
			  				<td class='old'>
			  					<select name="year" id="" class='year'>
			  						<option value="">年</option>
			  						<option value="1989" {{if value="$data['year'] eq 1989"}} selected="selected" {{endif}}>1989</option>
			  						<option value="1990" {{if value="$data['year'] eq 1990"}} selected="selected" {{endif}}>1990</option>
			  						<option value="1991" {{if value="$data['year'] eq 1991"}} selected="selected" {{endif}}>1991</option>
			  						<option value="1992" {{if value="$data['year'] eq 1992"}} selected="selected" {{endif}}>1992</option>

			  					</select>
			  					<select name="month" id="" class='month'>
			  						<option value="">月</option>
			  						<option value="1" {{if value="$data['month'] eq 1"}} selected="selected" {{endif}}>1</option>
			  						<option value="2" {{if value="$data['month'] eq 2"}} selected="selected" {{endif}}>2</option>
			  						<option value="3" {{if value="$data['month'] eq 3"}} selected="selected" {{endif}}>3</option>
			  						<option value="4" {{if value="$data['month'] eq 4"}} selected="selected" {{endif}}>4</option>
			  						<option value="5" {{if value="$data['month'] eq 5"}} selected="selected" {{endif}}>5</option>
			  						<option value="6" {{if value="$data['month'] eq 6"}} selected="selected" {{endif}}>6</option>
			  						<option value="7" {{if value="$data['month'] eq 7"}} selected="selected" {{endif}}>7</option>
			  						<option value="8" {{if value="$data['month'] eq 8"}} selected="selected" {{endif}}>8</option>
			  						<option value="9" {{if value="$data['month'] eq 9"}} selected="selected" {{endif}}>9</option>
			  						<option value="10" {{if value="$data['month'] eq 10"}} selected="selected" {{endif}}>10</option>
			  						<option value="11" {{if value="$data['month'] eq 11"}} selected="selected" {{endif}}>11</option>
			  						<option value="12" {{if value="$data['month'] eq 12"}} selected="selected" {{endif}}>12</option>

			  					</select>
			  					<select name="day" id="" class='day'>
			  						<option value="" >日</option>
			  						<option value="1" {{if value="$data['day'] eq 1"}} selected="selected" {{endif}}>1</option>
			  						<option value="2" {{if value="$data['day'] eq 2"}} selected="selected" {{endif}}>2</option>
			  						<option value="3" {{if value="$data['day'] eq 3"}} selected="selected" {{endif}}>3</option>
			  						<option value="4" {{if value="$data['day'] eq 4"}} selected="selected" {{endif}}>4</option>
			  						<option value="5" {{if value="$data['day'] eq 5"}} selected="selected" {{endif}}>5</option>
			  						<option value="6" {{if value="$data['day'] eq 6"}} selected="selected" {{endif}}>6</option>
			  						<option value="7" {{if value="$data['day'] eq 7"}} selected="selected" {{endif}}>7</option>
			  						<option value="8" {{if value="$data['day'] eq 8"}} selected="selected" {{endif}}>8</option>
			  						<option value="9" {{if value="$data['day'] eq 9"}} selected="selected" {{endif}}>9</option>
			  						<option value="10" {{if value="$data['day'] eq 10"}} selected="selected" {{endif}}>10</option>
			  						<option value="11" {{if value="$data['day'] eq 11"}} selected="selected" {{endif}}>11</option>
			  						<option value="12" {{if value="$data['day'] eq 12"}} selected="selected" {{endif}}>12</option>
			  						<option value="13" {{if value="$data['day'] eq 13"}} selected="selected" {{endif}}>13</option>
			  						<option value="14" {{if value="$data['day'] eq 14"}} selected="selected" {{endif}}>14</option>
			  						<option value="15" {{if value="$data['day'] eq 15"}} selected="selected" {{endif}}>15</option>
			  						<option value="16" {{if value="$data['day'] eq 16"}} selected="selected" {{endif}}>16</option>
			  						<option value="17" {{if value="$data['day'] eq 17"}} selected="selected" {{endif}}>17</option>
			  						<option value="18" {{if value="$data['day'] eq 18"}} selected="selected" {{endif}}>18</option>
			  						<option value="19" {{if value="$data['day'] eq 19"}} selected="selected" {{endif}}>19</option>
			  						<option value="20" {{if value="$data['day'] eq 20"}} selected="selected" {{endif}}>20</option>
			  						<option value="21" {{if value="$data['day'] eq 21"}} selected="selected" {{endif}}>21</option>
			  						<option value="22" {{if value="$data['day'] eq 22"}} selected="selected" {{endif}}>22</option>
			  						<option value="23" {{if value="$data['day'] eq 23"}} selected="selected" {{endif}}>23</option>
			  						<option value="24" {{if value="$data['day'] eq 24"}} selected="selected" {{endif}}>24</option>
			  						<option value="25" {{if value="$data['day'] eq 25"}} selected="selected" {{endif}}>25</option>
			  						<option value="26" {{if value="$data['day'] eq 26"}} selected="selected" {{endif}}>26</option>
			  						<option value="27" {{if value="$data['day'] eq 27"}} selected="selected" {{endif}}>27</option>
			  						<option value="28" {{if value="$data['day'] eq 28"}} selected="selected" {{endif}}>28</option>
			  						<option value="29" {{if value="$data['day'] eq 29"}} selected="selected" {{endif}}>29</option>
			  						<option value="30" {{if value="$data['day'] eq 30"}} selected="selected" {{endif}}>30</option>
			  						<option value="31" {{if value="$data['day'] eq 31"}} selected="selected" {{endif}}>31</option>
			  					</select>
							</td>
			  			</tr>
			  			<tr>
			  				<td class='td_left'>城市地区：</td>
			  				<td class='old'>
			  					<p id="show"><input class="btn btn-default" type="button" value="{{$data['address']}}">&nbsp;&nbsp;&nbsp;&nbsp;</p><input class="btn btn-success" type="button" id="edit" value="修改">
			  					
			  					<div class="form-control new" style="display:none">
			  						<select name="sheng" id="a1" class=''>
			  						<option value=""></option>
									
				  					</select>
				  					<select name="shi" id="a2" class=''>
				  						<option value=""></option>

				  					</select>
			  					</div>
			  					<input type="hidden" name="address" value="{{$data['address']}}">
			  				</td>
			  				
			  				<tr>
			  					<td class='tijiao'>
			  						<input type="hidden" name="uid" value="{{$data['uid']}}">
			  						<input type="submit" value="提交"  class='btn'/>
			  					</td>
			  					<td class='tijiao'>
			  						<a href="{{U('User/index')}}" type="button" class='btn' style="text-align: center;display:inline-block;line-height: 40px;">取消</a>
			  					</td>
			  				</tr>
			  			</tr>
			  		</table>
			  	</dd>
			</dl> 
			</form>
		</div>
		
					<!--foot-->
		<div class="hr-20"></div>
		<div class="custom-footer">
			<p><a href=""> 《华为帐号服务条款、华为隐私政策》</a> | <a href="">常见问题？ </a></p>
			<p>Copyright © 2011-2015  华为软件技术有限公司  版权所有  保留一切权利  苏B2-20070200号 | 苏ICP备09062682号-9</p>
		</div>
	</body>

</html>